const indexCodeMap: any = {
    // "sycm.taobao.com/flow/new/guide/trend.json": ['uv,itmUv,payByrCnt', 'pv', 'avgPv', 'oldUv', 'newUv', 'shopCltByrCnt', 'liveRoomUv', 'shortVideoUv', 'imageUv', 'shopVisitUv'],
    "sycm.taobao.com/flow/new/live/guide/trend.json": ['uv,itmUv,payByrCnt','uv', 'pv', 'avgPv', 'oldUv', 'newUv', 'shopCltByrCnt', 'liveRoomUv', 'shortVideoUv', 'imageUv', 'shopVisitUv','itmUv', 'miniDetailUv', 'itmPv', 'itmCltByrCnt', 'cartByrCnt', 'payByrCnt', 'payAmt', 'payRate', 'crtByrCnt', 'crtRate', 'uvValue', 'payPct'],
}
let interceptions: Array<ReqInit> = [];
Object.keys(indexCodeMap).map((url: string) => {
    indexCodeMap[url].map((item: string) => {
        interceptions.push({
            url: url,
            params: {
                indexCode: item,
            }
        })
    })
});
// 流量纵横
const flowMonitorOverviewInterception: Array<ReqInit> = [
    {
        // 流量纵横-概览
        url: 'sycm.taobao.com/flow/new/live/guide/trend/overview.json',
    },
    // 对indexCodeMap遍历 生成对应的请求
    ...interceptions,
];
export const getFlowMonitorOverviewInterception: ReqInit = flowMonitorOverviewInterception[0];
export function getFlowMonitorTrendInterception(indexCode: string, url: string = "sycm.taobao.com/flow/new/live/guide/trend.json"): ReqInit {
    return {
        url: url,
        params: {
            indexCode: indexCode,
        }
    }
}

export default flowMonitorOverviewInterception;
